import {ServerInfo} from "@/config/ServerInfoConfig.js";

export const fileUploadTableOption = {
    stripe: true, //条纹
    addBtn: false,
    viewBtn: true,
    searchIndex: 3,
    searchIcon: true,
    height: '68vh',
    selection: true, //多选
    reserveSelection: true, //翻页多选
    index: true, //加序号
    showSummary: true, //展开底部求和
    menuType: 'icon', // 操作栏改为图标展示
    loadingText: "数据加载中...",
    emptyText: '数据空空如也...',
    column: [
        {
            label: '主键', prop: 'id',
            hide: true,
        },
        {
            label: '上传用户',          // 对应 userId
            prop: 'userId',
            rules: [{required: true, message: '请输入用户ID', trigger: 'blur'}]
        },
        {
            label: '文件原始名',      // 对应 originalName
            prop: 'originalName',
            rules: [{required: true, message: '请输入文件原始名', trigger: 'blur'}]
        },
        {
            label: '系统文件名',      // 对应 storedName
            prop: 'sortedName',
            rules: [{required: true, message: '请输入系统文件名', trigger: 'blur'}]
        },
        {
            label: '文件URL',         // 对应 url
            prop: 'url',
        },
        {
            label: '存储桶',          // 对应 bucket
            prop: 'bucket',
        },
        {
            label: '节点', prop: 'endpoint',
            search: true
        },
        {label: '文件大小', prop: 'fileSize'},
        {
            label: '文件类型', prop: 'fileType',
            search: true,
            type: 'select', dicMethod: 'get',
            props: {
                label: 'key',
                value: 'value'
            },
            dicUrl: `${ServerInfo.BASE_URL}/fileUpload/fileTypeList`,
        },
        {
            label: '备注', prop: 'remark',
            type: 'textarea', span: 24
        },
    ]
}

export const fileUploadFormOption = {
    labelWidth: 120,
    column: [
        {
            label: '用户ID',          // 对应 userId
            prop: 'userId',
            rules: [{required: true, message: '请输入用户ID', trigger: 'blur'}]
        },
        {
            label: '文件原始名',      // 对应 originalName
            prop: 'originalName',
            rules: [{required: true, message: '请输入文件原始名', trigger: 'blur'}]
        },
        {
            label: '系统文件名',      // 对应 storedName
            prop: 'sortedName',
            rules: [{required: true, message: '请输入系统文件名', trigger: 'blur'}]
        },
        {
            label: '文件URL',         // 对应 url
            prop: 'url',
        },
        {
            label: '存储桶',          // 对应 bucket
            prop: 'bucket',
        },
        {label: '节点', prop: 'endpoint'},
        {label: '文件大小(字节)', prop: 'fileSize'},
        {label: '文件类型', prop: 'fileType'},
        {
            label: '备注', prop: 'remark',
            type: 'textarea', span: 24
        },
    ]
}